import axios from "axios"

export default class MaterialNeedModel{
  static MNM=null;

  static getInstance(){
    if(this.MNM==null){
      this.MNM=new MaterialNeedModel();
    }
    return this.MNM;
  }

  saveNeed(need,needDetails){//添加
    return axios.post("http://localhost/MaterialNeed",{"need":need,"needDetails":needDetails});
  }

  getNeed(args){//查询
    return axios.get("http://localhost/MaterialNeed",{params:{args}})
  }

  delNeed(id){
    return axios.delete(`http://localhost/MaterialNeed/${id}`)
  }

  getNeedDetails(needId){
    return axios.get(`http://localhost/MaterialNeedDetail/${needId}`)
  }
}